package com.cloudkinto.vo.stock;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PlatformSkuStockDto {

    private Long id;

    private Long storeId;

    private String platformSku;

    private String variantId;

    private String parentSku;

    private Integer hideItem;

    private String fulfillmentChannelCode;

    private Double stockPercent;

    @ApiModelProperty("系统sku 单位数量")
    private int qty;

    private BigDecimal price;

    private String sku;

    private Long systemProductId;
    @ApiModelProperty("可用库存 = 系统库存 + 预售在途 - 待处理数量\n" +
            "即回传到平台的库存")
    private Integer leftQty;

    @ApiModelProperty("option_name1")
    private String optionName1;

    @ApiModelProperty("option_name2")
    private String optionName2;
    @ApiModelProperty("option_name3")
    private String optionName3;

    @ApiModelProperty("option_value1")
    private String optionValue1;
    @ApiModelProperty("option_value2")
    private String optionValue2;
    @ApiModelProperty("option_value3")
    private String optionValue3;

    //wowma 回传库存用
    private String shippingDayId;
    private String optionHorizontalSeq;
    private String optionVerticalSeq;
    private String horizontalItemName;
    private String verticalItemName;
    public int getQty() {
        return qty <= 0 ? 1 : qty;
    }

    public PlatformSkuStockDto(Long storeId, String platformSku, String parentSku, Double stockPercent, int qty) {
        this.storeId = storeId;
        this.platformSku = platformSku;
        this.parentSku = parentSku;
        this.stockPercent = stockPercent;
        this.qty = qty;
    }
}
